<template>

  <el-dialog title="证件照片" :visible.sync="dialogTableVisible"
             :before-close="dialogTableVisibleClose"
             append-to-body>


    <div class="block" v-for="obj of tableCertificatesPhotoData" >
<!--        style="width: 100px; height: 100px"-->
      <el-image
        :src="read(obj.zplj)"
        ></el-image>
      <span class="demonstration">({{ obj.sm }})</span>
    </div>

  </el-dialog>




</template>

<script>

  import {checkNull, readImages} from '@/utils/utils'

  export default {
    name: "PhotoCertificatesDetails",
    props:{
      tableCertificatesPhotoData: [],
      dialogTableVisible: Boolean,
    },
    data(){
      return {
      }
    },
    methods: {
      /**
       * 读取照片
       * @param path
       * @return {*}
       */
      read(path){
        // 照片路径为空，则展示默认图片
        if (checkNull(path)) {
          return path;
        } else {
          return readImages(path)
        }
      },
      /**
       * 关闭弹框
       */
      dialogTableVisibleClose(){
        this.$emit('dialogTableVisibleClose', null)
      }
    }
  }
</script>

<style scoped>

</style>
